package Day30;

public class enummer2 {
    public static void main(String[] args) {
        /*System.out.println(Season2.SPRING);
        System.out.println(Season3.AUTUMN);*/
        Season2 autumn = Season2.AUTUMN;
        System.out.println(autumn);
        System.out.println(autumn.name());
        System.out.println(autumn.ordinal());
        Season2[] values = Season2.values();
        Season2 autumn1 = Season2.valueOf("AUTUMN");
        System.out.println("autumn1 = " + autumn1);
        System.out.println(Season2.AUTUMN.compareTo(Season2.SPRING));
    }
}

class Season3{
    private String name;
    private String desc;

    private  Season3(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public static final Season3 SPRING = new Season3("春天","温暖");
    public static final Season3 SUMMER = new Season3("夏天","凉爽");
    public static final Season3 AUTUMN = new Season3("秋天","炎热");
    public static final Season3 WINTER = new Season3("冬天","寒冷");

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "Season3{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}

enum Season2{
    SPRING("春天","温暖"),SUMMER("夏天","炎热"),
    AUTUMN("秋天","凉爽"),WINTER("冬天","寒冷");
    private String name;
    private String desc;

    Season2(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "Season2{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
